﻿<UserControl x:Class="GBlason.Control.Aggregate.CoatOfArmsViewer"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:ViewModel="clr-namespace:GBlason.ViewModel" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" mc:Ignorable="d" 
             d:DesignHeight="632" d:DesignWidth="453">
    <DockPanel VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
        <ScrollViewer Width="Auto" Height="Auto" DockPanel.Dock="Top"
                      HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                      x:Name="GlobalScrollViewer" SizeChanged="GlobalScrollViewerSizeChanged" 
                      HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
            <ItemsControl ItemsSource="{Binding Path=RootCoatOfArm.FlattenedTreeView.Values}">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <Canvas x:Name="CanvasCoA" Width="{Binding Path=RootCoatOfArm.CurrentShape.ActualWidth}"
                                Height="{Binding Path=RootCoatOfArm.CurrentShape.ActualHeight}">
                            <Canvas.LayoutTransform>
                                <ScaleTransform
                                    ScaleX="{Binding Path=ZoomLevel}"
                                    ScaleY="{Binding Path=ZoomLevel}"/>
                            </Canvas.LayoutTransform>
                        </Canvas>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Path />
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>

        </ScrollViewer>
    </DockPanel>
</UserControl>
